package com.zcoj.service;

import com.zcoj.pojo.Dto.Source;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

@CacheConfig(cacheNames = "SourceService")
public interface SourceService {

    @CacheEvict(value = "SourceService",allEntries = true)
    public Integer create(Source source);

    @Cacheable(key = "'findAll'")
    public List<Source> findAll();


    @Cacheable(key = "#p0.toString()+'findById'")
    public Source findById(Integer id);


    @CacheEvict(value = "SourceService",allEntries = true)
    public Integer deleteById(Integer id);


    @CacheEvict(value = "SourceService",allEntries = true)
    public Integer updateById(Source source);
}
